package com.deduction.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.base.common.persistence.Page;
import com.base.common.service.CrudService;
import com.company.model.CompanyProject;
import com.deduction.dao.ProjectExternalEmployeeMapper;
import com.deduction.model.ProjectExternalEmployee;
import com.deduction.service.ProjectExternalEmployeeService;

@Service
public class ProjectExternalEmployeeServiceImpl extends
		CrudService<ProjectExternalEmployeeMapper, ProjectExternalEmployee>
		implements ProjectExternalEmployeeService {
	
	public Page findProjectExternalPageByProjectId(String projectId, Page page)
			throws Exception {

		Map<String, String> params = new HashMap<String, String>();
		params.put("projectId", projectId);
		String sql = "SELECT t.*, w.wbs_name from project_external_employee t , project_wbs w where t.project_wbs_id = w.id and t.project_id =  #{projectId} ";
		page = this.getPage(page, sql, ProjectExternalEmployee.class, params);
		return page;
	}
}
